package com.bawei.demo_shoppingcar.application;

import android.graphics.Bitmap;

import com.bawei.demo_shoppingcar.R;
import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.assist.ImageScaleType;
import com.nostra13.universalimageloader.core.display.FadeInBitmapDisplayer;

import java.util.HashMap;

/**
 * Created by HP on 2017/3/16.
 */

public class ContentData {

    public static final String classifyURL = "http://m.yunifang.com/yunifang/mobile/category/list?random=96333&encode=bf3386e14fe5bb0bcef234baebca2414";
    public static final String url = "http://m.yunifang.com/yunifang/mobile/home?random=84831&encode=9dd34239798e8cb22bf99a75d1882447";
    public static String user_qq_image = null;
    public static String user_qq_name = null;

    public static String getUser_qq_name() {
        return user_qq_name;
    }

    public static void setUser_qq_name(String user_qq_name) {
        ContentData.user_qq_name = user_qq_name;
    }

    //记录登录状态
    private static boolean isLogin_QQ = false;

    public static boolean isLogin_QQ() {

        return isLogin_QQ;
    }

    public static void setIsLogin_QQ(boolean isLogin_QQ) {
        ContentData.isLogin_QQ = isLogin_QQ;
    }

    public static final DisplayImageOptions options = new DisplayImageOptions.Builder()
            // 设置图片在下载期间显示的图片
            .showImageOnLoading(R.drawable.ic_stub)
            // 设置图片Uri为空或是错误的时候显示的图片
            .showImageForEmptyUri(R.drawable.ic_stub)
            // 设置图片加载/解码过程中错误时候显示的图片
            .showImageOnFail(R.drawable.ic_stub)
            // 设置下载的图片是否缓存在内存中
            .cacheInMemory(true)
            // 设置下载的图片是否缓存在SD卡中
            .cacheOnDisc(true)
            // 保留Exif信息
            .considerExifParams(true)
            // 设置图片以如何的编码方式显示
            .imageScaleType(ImageScaleType.EXACTLY_STRETCHED)
            // 设置图片的解码类型
            .bitmapConfig(Bitmap.Config.RGB_565)
            // .decodingOptions(android.graphics.BitmapFactory.Options
            // decodingOptions)//设置图片的解码配置
            .considerExifParams(true)
            // 设置图片下载前的延迟
            .delayBeforeLoading(100)// int
            // delayInMillis为你设置的延迟时间
            // 设置图片加入缓存前，对bitmap进行设置
            // .preProcessor(BitmapProcessor preProcessor)
            .resetViewBeforeLoading(true)// 设置图片在下载前是否重置，复位
            // .displayer(new RoundedBitmapDisplayer(20))//是否设置为圆角，弧度为多少
            .displayer(new FadeInBitmapDisplayer(100))// 淡入
            .build();

    public static HashMap<String, String> hashMap = new HashMap<>();

    public static void setMapData() {
        hashMap.put("补水保湿", "http://m.yunifang.com/yunifang/mobile/goods/getall?random=60305&encode=b0358434fda8d7478bfc325b5828b721&category_id=17");
        hashMap.put("美白提亮", "http://m.yunifang.com/yunifang/mobile/goods/getall?random=59154&encode=4f90b7d8723b9819b90acf2a845abe98&category_id=18");
        hashMap.put("实惠套装", "http://m.yunifang.com/yunifang/mobile/goods/getall?random=47920&encode=d4b0bb7403d31c66f22c33397ad896e3&category_id=33");
        hashMap.put("贴士面膜", "http://m.yunifang.com/yunifang/mobile/goods/getall?random=83560&encode=3108ed0b9a42c1e160b2912a78692263&category_id=9");
        hashMap.put("控油祛痘", "http://m.yunifang.com/yunifang/mobile/goods/getall?random=50464&encode=789002e73efb3ab24ecd56d42df3ef49&category_id=19");
        hashMap.put("洁面乳", "http://m.yunifang.com/yunifang/mobile/goods/getall?random=24799&encode=ebe717bb1c72e105ca7d55d3ce463bab&category_id=24");
    }


}
